package no_git_group.pages;

import org.openqa.selenium.By;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;

import static org.openqa.selenium.support.ui.ExpectedConditions.*;

public class AddMoviePage extends AnyPage {

	public AddMoviePage(PageManager pages) {
		super(pages);
	}

  @FindBy(name = "name")
  private WebElement movieTitle;
  
  @FindBy(name = "year")
  private WebElement movieYear; 
  
  @FindBy(id = "submit")
  private WebElement submitButton;

  public AddMoviePage setTitle(String title) {
    movieTitle.sendKeys(title);
    return this;
  	}
  
  public AddMoviePage setYear(String year) {
	movieYear.sendKeys(year);
	return this;
    }
  
  public void clickSubmit() {
	submitButton.click();
    }
}